

#include "Macros.asm"

BasicBuildings .equ 1
ResearchBuildings .equ 2


StructuresMenu .equ 1
ShipMenu .equ 0
OperationsMenu .equ 2
Argo_Laboratory_Menu .equ 3
AdvancedStructuresMenu .equ 4
GroupOfShipsMenu .equ 5
BuildingMenu .equ 7

Draw_Menu:

 ld a, (MenuIdentity)		;What menu are we displaying? 
 cp StructuresMenu
 jr z, Draw_Structures_Menu
 cp AdvancedStructuresMenu
 jr z, Draw_Advanced_Structures_Menu
 cp GroupOfShipsMenu
 jr z, Draw_Group_Of_Ships_Menu
 or a
 jr z, Draw_Ship_Menu
 ld hl, (Current_Menu)
 call Draw_Icon_Menu
 ret

Draw_Structures_Menu:



 ld hl, Build_Basic_Buildings

 call Draw_Icon_Menu

 ret

Draw_Advanced_Structures_Menu:

 ld hl, Build_Research_Buildings

 call Draw_Icon_Menu

 ret

Draw_Group_Of_Ships_Menu:

 ld hl, Edit_Ship_Group_Menu

 call Draw_Icon_Menu

 ret

Draw_Ship_Menu:

 ld hl, Exchange_Ship

 call Draw_Icon_Menu

 ret


AddBuildingToGame:  

 BIT Object_Ready_To_Add, (IY + asm_flag1)
 jr nz, _

 SET Object_Ready_To_Add, (IY + asm_flag1)
 B_CALL _Rotate_Cursor_Mode
 ld a,c
 ld (BuildingSelected),a
 RET




_

 RES Object_Ready_To_Add, (IY + asm_flag1)
 B_CALL _Rotate_Cursor_Mode
 
	ret




CheckMenuOkay:

 ld hl, (Current_Menu)
 ld a, (hl)
 cp 1
 jr nz, _

 scf
 ret

_

 or a
 ret

MenuMoveRight:

 ld hl, (Current_Menu)
 ld a, (hl)
 cp 1
 jr z, _

 ld a, (TagX)
 cp 32
 ret z
 add a, 16

 ld (TagX),a


 ret

_

 ld hl, (Current_Menu)
 inc hl
 ld c, (hl)
 ld a, (TagX)
 cp c
 ret z

 add a, 16
 ld (TagX), a
 ret


